﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Master/List.Master" AutoEventWireup="true"
    CodeBehind="MenuList.aspx.cs" Inherits="DevFx.Web.Pages.Systems.MenuList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderHeader" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            gridview("<%=gvList.ClientID %>");
        });
        function show(id, flag) {
           // window.showModalDialog("MenuEdit.aspx?time=" + new Date() + "&&id=" + id + "&&flag=" + flag, "", "dialogWidth:" + 500 + "px;dialogHeight:" + 200 + "px;center:yes;status:no;scroll:yes;help:no;");
           // return window.showModalDialog("MenuEdit.aspx?time=" + new Date() + "&&id=" + id + "&&flag=" + flag, "", "dialogWidth:600px;dialogHeight:350px;center:yes;status:no;scroll:yes;help:no;");
           return showWin("MenuEdit.aspx?time=" + new Date() + "&&id=" + id + "&&flag=" + flag, 600, 350);
         }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div  class="top">
    <asp:Button  runat="server" ID="btnadd" Text=" 添 加 " CssClass="button2"  onclick="btnadd_Click"  OnClientClick="return show('','1');"/>
    <asp:Button  runat="server" ID="btndel" Text=" 删 除 " CssClass="button2" onclick="btndel_Click"  OnClientClick='return DeleteCount("<%=gvList.ClientID %>");'/>

</div>
    <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" 
        CssClass="gv" AllowSorting="true"
        BorderStyle="None" onsorting="gvList_Sorting" 
        onrowcommand="gvList_RowCommand" >
        <Columns>
             <asp:TemplateField >
                <ItemTemplate >
                    <asp:CheckBox ID="cbx1" runat="server"  />
                </ItemTemplate>
                <HeaderTemplate  >
                    <asp:CheckBox ID="cbx1" runat="server" />
                </HeaderTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="MenuID" HeaderText="MenuID" SortExpression="MenuID" />
          <%--  <asp:BoundField DataField="ParentID" HeaderText="ParentID" SortExpression="ParentID" />--%>
            <asp:BoundField DataField="Name" HeaderText="中文名称" SortExpression="Name" />
            <asp:BoundField DataField="Code" HeaderText="英文名称" SortExpression="Code"/>
            <asp:BoundField DataField="Url" HeaderText="Url" SortExpression="Url"/>
            <asp:BoundField DataField="OrderNo" HeaderText="排序号" SortExpression="OrderNo"/>
            <asp:BoundField DataField="Level" HeaderText="级别" SortExpression="Level"/>
            <asp:TemplateField HeaderText="">
                <ItemTemplate>
                    <img  src="../../Contents/images/edit.gif" height="13" width="13"/>
                    <asp:LinkButton runat="server"   ID="btnlink"  OnClientClick='<%# " return show(\"" + Eval("MenuID").ToString() + "\",2);" %>' Text="编辑" CommandName="editing"></asp:LinkButton>
                     <img  src="../../Contents/images/delete.gif" height="13" width="13"/>
                     <asp:LinkButton runat="server"  CommandArgument='<%#Eval("MenuID") %>' CommandName="Del"  ID="btndel"  OnClientClick='return confirm("您确认删除吗？","删除"); ' Text="删除"></asp:LinkButton>
                    <asp:HiddenField  runat="server" ID="hfID" Value='<%#Eval("MenuID") %>'/>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
   
</asp:Content>
